package controller;
import model.*;
public class OrderController
{private OrderContainer orderCont;
  
    public OrderController()
    {
       orderCont=OrderContainer.getInstance();
    }
    public Order findOrder(String number){
    Order order=orderCont.findOrder(number);
    if(order !=null){
        return order;}
    else{
        System.out.println("No such order in the system");
            return null;
    }
}
     public boolean addOrder(String number, String date,String state,Product product,OrderLine quantity)
    {
        Order orderObj = new Order(number,date,state);
        if(orderObj != null)
        {
            orderCont.addOrder(orderObj);
            return true;
        }
        else 
        {
            return false;
        }
    }
 public boolean removeOrder(String number) {
        if(findOrder(number)!= null) 
        {
            orderCont.removeOrder(number);
            return  true;
        }
        else 
        {
            return false;
        }
    }
}
